package avishay.balderman.dao;

import java.util.Date;
import java.util.List;

import javax.jdo.annotations.Key;
import javax.persistence.Entity;
import javax.persistence.Id;

@Entity
public class TeamMember 
{
	
	public String getFirstName() {
		return firstName;
	}
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	public String getLastName() {
		return lastName;
	}
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public List<String> getPhoneNumbers() {
		return phoneNumbers;
	}
	public void setPhoneNumbers(List<String> phoneNumbers) {
		this.phoneNumbers = phoneNumbers;
	}
	public Date getBirthDay() {
		return birthDay;
	}
	public void setBirthDay(Date birthDay) {
		this.birthDay = birthDay;
	}
	
	public String getPhoneNumbersAsHTML()
	{
		if(phoneNumbers == null || phoneNumbers.isEmpty())
		{
			return "";
		}
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.append("<select>");
		
		for(String phoneNumber : phoneNumbers)
		{
			stringBuilder.append("<option>");
			stringBuilder.append(phoneNumber);
			stringBuilder.append("</option>");
		}
		stringBuilder.append("</select>");		
		return stringBuilder.toString();
	}
	private String firstName;
	private String lastName;
	@Id
	private String email;
	private String address;
	private List<String> phoneNumbers;
	private Date birthDay;
}
